Military academies were and still are nation-wide institutions.
They appeared at the same time that large standing national armies appeared.
These require a large and competent officer corps, something that the traditional nobility could not provide.
The first military academy was the Royal Danish Naval Academy, established in 1701 CE.
During the 18th century CE, other countries followed the Danish example and set up institutions of their own.
At first the focus was on mathematics and engineering, to produce competent artillerists and engineers,
but soon the curriculum was expanded to include military history, tactics, logistics, psychology and more,
producing a wide range of officers.
Many military academies are state-sponsored, others are private institutions.
In modern times, not all graduates are required to pursue a military career.
War Matrix - Military academy
Age of Reason 1620 CE - 1750 CE, Weapons and technology